home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
internet
/
yam_i_dodatki
/
yammailcheck
/
mailcheck.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-03-22
|
2KB
|
139 lines
/* $VER: MailCheck 1.2 (16.03.97) */
/* */
/* Automated E-Mail checking with Miami and YAM */
/* */
/* ©1997 DCS Softwate by Robert Wilson */
options results
open('var','env:ModemStatus','R')
ModStat = readln('var')
close('var')
IF ModStat ~= 0 THEN DO
if show('p', 'MIAMI.1') then do
address 'MIAMI.1'
ISONLINE
If RC = 0 then do
say 'Error - Modem not ready.'
say ""
open('var','env:MCStep','W')
writeln('var','0')
close('var')
exit
end
end
END
if show('P','YAM')=0 then do
address command 'run <>nil: yam:yam nocheck'
i=0
do until show('P','YAM')>0 | i=3
address command 'sys:rexxc/WaitForPort YAM'
i=i+1
end
if show('P','YAM')=0 then do
say 'Error - YAM failed to start.'
say ""
open('var','env:MCStep','W')
writeln('var','0')
close('var')
exit
end
end
if show('P','MIAMI.1')=0 then do
address command 'run <>nil: Miami:Miami'
i=0
do until show('P','MIAMI.1')>0 | i=3
address command 'sys:rexxc/WaitForPort MIAMI.1'
i=i+1
end /* do */
if show('P','MIAMI.1')=0 then do
say 'Error - Miami failed to start.'
say ""
open('var','env:MCStep','W')
writeln('var','0')
close('var')
exit
end
end
address 'MIAMI.1'
ISONLINE
Already = RC
If Already = 0 then do
ONLINE
end
ISONLINE
Again = RC
If Again = 0 then do
say 'Error - Could not get Miami on-line.'
say ""
open('var','env:MCStep','W')
writeln('var','0')
close('var')
exit
END
Address 'YAM'
mailcheck
Anymail = Result
IF Anymail = -1 then do
say 'Error - Could not connect to mail server.'
say ""
open('var','env:MCStep','W')
writeln('var','0')
close('var')
If Already = 0 then do
address 'MIAMI.1'
OFFLINE
end
exit
END
If Anymail = 0 then do
say 'Connected - No new mail received.'
say ""
end
If Anymail ~= 0 then do
If Anymail = 1 then do
say 'Connected - 1 new mail received.'
say ""
end
else do
say 'Connected -' Anymail 'new mails received.'
say ""
end
address command 'run <>nil: s:SampleCheck'
end
open('var','env:MCStep','W')
writeln('var','1')
close('var')
open('var','env:MCMail','W')
writeln('var',Anymail)
close('var')
open('var','env:MCOkay','W')
writeln('var','1')
close('var')
address command 'Copy Env:MCTempDate Env:MCDate QUIET CLONE'
If Already = 0 then do
address 'MIAMI.1'
OFFLINE
exit
end
exit